/*
 * Copyright 2008 CSC Consulting Group under the Apache License, 
 * Version 2.0 (the "License"); you may not use this file except in 
 * compliance with the License. You may obtain a copy of the License at 
 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable 
 * law or agreed to in writing, software distributed under the License is 
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
 * either express or implied. See the License for the specific language 
 * governing permissions and limitations under the License.
 */
package com.waw.journal.plugin.action;
import com.waw.journal.plugin.JournalConsts;

/**
 * This action class supports the presentation of help for the Fitness Journal page.
 * It makes the user's setting for the journal user name, password, and autologin visible to the 
 * page being rendered.
 *
 * @author jtremlett
 */
public class HelpJournalAction extends BaseJournalAction 
{

	private static final long serialVersionUID = 1L;
	
	/**
	 * Returns the user name for this user.
	 * @return String with the user name.
	 */
	public String getMyName()
	{
		String username = this.getUser().getProperties().get(JournalConsts.USER_JOURNAL_USERNAME);
		if(username == null) return "";
		return username;
	}
	
	/**
	 * Returns the password for this user.
	 * @return a String holding the password.
	 */
	public String getPassword()
	{
		String password = this.getUser().getProperties().get(JournalConsts.USER_JOURNAL_PASSWORD);
		if(password == null) return "";
		return password;
	}
	
	/**
	 * Returns the autologin setting for this user.
	 * @return a String with the auto login setting.
	 */
	public String getAutoLogin()
	{
		String autologin = this.getUser().getProperties().get(JournalConsts.USER_JOURNAL_AUTOLOGIN);
		if(autologin == null) return "";
		return autologin;
	}
}
